﻿namespace PowerSong.UserInterface
    {
    using PowerSong.SongDatabase;
    using System.Windows.Media;

    public static class StyleManager
        {

        public static Style CreateDefault(string name)
            {
            var result = new Style(name);
            result.BackgroundColor = Color.FromArgb(255, 20, 20, 100).ToUInt();

            // Configure the title substyle
            var titleStyle = new SubStyle("Title")
                {
                Margin = new SubStyleMargin(0, 0, 0, 0.9),
                FontName = "Verdana",
                FontSize = 0.5,
                FontStyle = FontEffectType.Bold,
                FontColor = Colors.White.ToUInt(),
#warning Test
                FontEffect = TextEffectType.None,
#warning Test
                FontEffectColor = 0,
                TextAlignment = Alignment.CenterBottom,
                FadeIn = new SubStyleFadeDetails(FadeType.Fade, 1000),
                FadeOut = new SubStyleFadeDetails(FadeType.Fade, 1000),
                CrossFade = new SubStyleFadeDetails(FadeType.None, 0),
#warning Test
                Visibility = TextVisibility.FirstVerseOnce
                };
            result.AddSubStyle(titleStyle);

            // Configure the verse substyle
            var verseStyle = new SubStyle("Verse")
                {
                Margin = new SubStyleMargin(0, 0, 0, 0),
                FontName = "Calibri",
                FontSize = 0.5,
                FontStyle = FontEffectType.Italic,
                FontColor = Colors.White.ToUInt(),
                FontEffect = TextEffectType.ShadowText,
                FontEffectColor = 0,
                TextAlignment = Alignment.CenterMiddle,
                FadeIn = new SubStyleFadeDetails(FadeType.Fade, 1000),
                FadeOut = new SubStyleFadeDetails(FadeType.Fade, 1000),
                CrossFade = new SubStyleFadeDetails(FadeType.Fade, 250),
                Visibility = TextVisibility.Always
                };
            result.AddSubStyle(verseStyle);

            // Configure the copyright substyle
            var copyrightStyle = new SubStyle("Copyright")
                {
                Margin = new SubStyleMargin(0, 0.8, 0, 0.03),
                FontName = "Times New Roman",
                FontSize = 0.25,
                FontStyle = FontEffectType.None,
                FontColor = Colors.LightBlue.ToUInt(),
                FontEffect = TextEffectType.None,
                FontEffectColor = 0,
                TextAlignment = Alignment.CenterBottom,
                FadeIn = new SubStyleFadeDetails(FadeType.None, 1000),
                FadeOut = new SubStyleFadeDetails(FadeType.None, 1000),
                CrossFade = new SubStyleFadeDetails(FadeType.None, 0),
                Visibility = TextVisibility.LastVerseOnce
                };
            result.AddSubStyle(copyrightStyle);

            // Return the style
            return result;

            }

        }

    }
